#ifndef __BSP_W25Q64_H
#define __BSP_W25Q64_H

#include "../../imx6ul/imx6ul.h"
#include "../spi/bsp_spi.h"
#include "W25Q64_Ins.h"

#define MySPI_Start() gpio_pinwrite(GPIO1, 20, 1)
#define MySPI_Stop() gpio_pinwrite(GPIO1, 20, 0)
#define MySPI_SwapByte(x) SPI_Mode0_SwapByte(ECSPI3, (unsigned char)x)
#define MySPI_Init() SPI_Init(ECSPI3)

void W25Q64_Init(void);
void W25Q64_ReadID(uint8_t *MID, uint16_t *DID);
void W25Q64_PageProgram(uint32_t Address, uint8_t *DataArray, uint16_t Count);
void W25Q64_SectorErase(uint32_t Address);
void W25Q64_ReadData(uint32_t Address, uint8_t *DataArray, uint32_t Count);

#endif
